package com.lbj.googleplay.googleplay100.global;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Process;
/*
自定义application,初始化一些全局的属性
*
* */
public class MyApplication extends Application {

    private static Context context;
    private static Handler handler;
    private static long mainThreadId;

    @Override
    public void onCreate() {
        super.onCreate();
         context = getApplicationContext();
         handler = new Handler();
         mainThreadId = Process.myTid();//获取当前线程id,此处是主线程id
    }

    public static Context getContext() {
        return context;
    }



    public static Handler getHandler() {
        return handler;
    }


    public static long getMainThreadId() {
        return mainThreadId;
    }

}
